const env = process.env.NODE_ENV;

// mysql 和 redis 的配置文件
let MYSQL_CONF, REDIS_CONF;

if (env === 'development') {
    MYSQL_CONF = {
        host: '127.0.0.1',
        user: 'root',
        password: 'root',
        port: '3306',
        database: 'blog'
    };

    REDIS_CONF = {
        port: 6379,
        host: '127.0.0.1'
    };
} else if (env === 'production') {
    MYSQL_CONF = {
        host: '127.0.0.1',
        user: 'root',
        password: 'root',
        port: '3306',
        database: 'blog'
    };

    REDIS_CONF = {
        port: 6379,
        host: '127.0.0.1'
    };
} else {
    MYSQL_CONF = {
        host: '127.0.0.1',
        user: 'root',
        password: 'root',
        port: '3306',
        database: 'blog'
    };

    REDIS_CONF = {
        port: 6379,
        host: '127.0.0.1'
    };
}

module.exports = {
    MYSQL_CONF,
    REDIS_CONF
};
